<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>
        修改供应商报价
    </title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="../../../../css/main.css" media="all">
    <script type="text/javascript" src="../../../../lib/loading/okLoading.js"></script>
    <link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="../../../../lib/layui/css/layui_2.5.7.css">

</head>
<style>
</style>

<body>
<div class="x-body" id="app">
    <form class="layui-form layui-form-pane">
        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">
                <div class="layui-form-item">
                    <label class="layui-form-label">配件名称</label>
                    <div style="width: 72%" class="layui-input-inline">
                        <input  autocomplete="off"  disabled readonly type="text" v-model="partsPrice.partsName" name="partsName"
                               placeholder="配件名称" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label"> 规格型号</label>
                    <div style="width: 72%" class="layui-input-inline">
                        <input  autocomplete="off"  disabled readonly type="text" v-model="partsPrice.specification" name="specification"
                               placeholder="规格型号" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label"> 关联物料</label>
                    <div style="width: 72%" class="layui-input-inline">
                        <input  autocomplete="off"  disabled readonly type="text" v-model="partsPrice.partsNum" name="partsNum"
                               placeholder="关联物料" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">供应商料号</label>
                    <div style="width: 72%" class="layui-input-inline">
                        <input  autocomplete="off"  type="text" v-model="partsPrice.supplierNum" name="supplierNum"
                               placeholder="供应商料号" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label"> 配件报价</label>
                    <div style="width: 72%" class="layui-input-inline">
                        <input  autocomplete="off"  type="text" v-model="partsPrice.partsOffer" name="partsOffer"
                               placeholder="配件报价" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">备注信息</label>
                    <div style="width: 70%" class="layui-input-inline">
                         <textarea v-model="partsPrice.offerRemark" name="offerRemark" placeholder="请输入内容"
                                   class="layui-textarea"></textarea>
                    </div>
                </div>
                <div style="height:20px;"></div>
            </div>
        </div>
    </form>
</div>
<script type="text/javascript" src="../../../../js/jquery.min.js"></script>
<script type="text/javascript" src="../../../../js/myAjax.js"></script>
<script type="text/javascript" src="../../../../js/pub.js"></script>
<script src="../../../../lib/layui/layui2.5.7.js" charset="utf-8"></script>
<script src="../../../../js/x-layui.js" charset="utf-8"></script>
<script src="../../../../js/vue.min.js" charset="utf-8"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.3.5/js/bootstrap.min.js"></script>

<script>
    layui.use(['element', 'layer', 'form', 'laydate'], function () {
        $ = layui.jquery;//jquery
        lement = layui.element();//面包导航
        layer = layui.layer;//弹出层
        laydate = layui.laydate;//日期插件
        form = layui.form;
        okLoading.close($);
    })
</script>
<script>

    new Vue({
        el: "#app",
        data: {
            partsPrice: JSON.parse(localStorage.getItem("edit_parts_offer")),
        },
        watch: {
            partsPrice: {
                handler: (val, olVal) => {
                    localStorage.setItem("edit_parts_offer", JSON.stringify(val));
                    let partsNum = val.partsNum;
                    let selectedPartsOffers = JSON.parse(localStorage.getItem("selected_parts_offers"));
                    $.each(selectedPartsOffers, (index, item) => {
                        if (item.partsNum === partsNum) {
                            selectedPartsOffers.splice(index, 1, val);
                            localStorage.setItem("selected_parts_offers", JSON.stringify(selectedPartsOffers))
                        }

                    })


                },
                deep: true
            },
        },
        computed: {
            partsPrice() {
                return this.partsPrice;
            }
        }

    });
</script>

</body>

</html>
